<template>
  <div class="responsive-container">
    <h1>响应式布局示例</h1>
    <div class="content">
      <div class="box">Box 1</div>
      <div class="box">Box 2</div>
      <div class="box">Box 3</div>
    </div>
  </div>
</template>

<script setup>
// 这里不需要额外的逻辑
</script>

<style scoped>
.responsive-container {
  padding: 20px;
  background-color: #f0f0f0;
  text-align: center;
}

.content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.box {
  background-color: #409eff;
  color: white;
  padding: 20px;
  border-radius: 8px;
  flex: 1 1 calc(30% - 40px); /* 默认 PC 端：3 列 */
  max-width: calc(30% - 40px);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .box {
    flex: 1 1 100%; /* 移动端：1 列 */
    max-width: 100%;
  }
}
</style>
